<template>
  <a-card :bodyStyle="{ padding: '0 24px' }" :bordered="false">
    <a-tabs v-model="actKey" @change="callback">
      <a-tab-pane key="1" :tab="$t('运营参数')">
        <div style="display: flex; padding: 14px 0">
          <div style="width: 140px; line-height: 32px; font-weight: bold; color: #000">{{ $t('经营时间') }}</div>
          <a-row :gutter="[0, 24]" style="width: calc(100% - 140px)">
            <a-col :span="24">
              <span>{{ $t('经营开始时间:') }}</span>
              <a-time-picker v-model="time.svalue" format="HH:mm" valueFormat="HH:mm:ss" style="margin-left: 10px" />
              <a-button type="primary" style="margin-left: 20px" @click="timeSave()" v-has="'BisSysParameterController:edit'">{{ $t('保存') }}</a-button>
              <span style="margin-left: 10px; color: orange">{{
                $t('（一个经营周期是自经营开始时间往后的24小时）')
              }}</span>
            </a-col>
          </a-row>
        </div>
        <div style="display: flex; padding: 14px 0">
          <div style="width: 140px; line-height: 32px; font-weight: bold; color: #000">{{ $t('终端结账') }}</div>
          <a-row :gutter="[0, 24]" style="width: calc(100% - 140px)">
            <a-col :span="24">
              <a-checkbox v-model="checkState">{{ $t('自动结账') }}</a-checkbox>
              <span style="margin-left: 20px">{{ $t('结账时间') }}：</span>
              <a-time-picker
                :disabled="!checkState"
                v-model="checkTime"
                format="HH:mm"
                valueFormat="HH:mm"
                style="margin-left: 10px"
              />
              <a-button type="primary" style="margin-left: 20px" @click="checkSave" v-has="'BisSysParameterController:edit'">{{ $t('保存') }}</a-button>
              <span style="margin-left: 20px; color: orange">{{
                $t('（开启该功能后到了设定时间系统将自动执行各终端的结账，24小时连续营业建议结账时间和经营时间保持一致）')
              }}</span>
            </a-col>
          </a-row>
        </div>
        <div style="display: flex; padding: 14px 0">
          <div style="width: 140px; line-height: 32px; font-weight: bold; color: #000">{{ $t('金额符号') }}</div>
          <a-row :gutter="[0, 24]" style="width: calc(100% - 140px)">
            <a-col :span="24">
              <a-input v-model="currencySymbol.svalue" style="width: 200px"></a-input>
              <a-button type="primary" style="margin-left: 20px" @click="parameterChange('currencySymbol')" v-has="'BisSysParameterController:edit'">{{ $t('保存') }}</a-button>
            </a-col>
          </a-row>
        </div>
        <div style="display: flex; padding: 14px 0">
          <div style="width: 140px; font-weight: bold; color: #000">{{ $t('千位分隔符') }}</div>
          <a-row :gutter="[0, 24]" style="width: calc(100% - 140px)">
            <a-col :span="24">
              <a-checkbox :checked="thousandsSeparator.ivalue == 1" @change="(e) => changeSelectState(e, 'thousandsSeparator', 'ivalue', 1, 'autoSave')">{{ $t('启用') }}</a-checkbox>
            </a-col>
          </a-row>
        </div>
        <div style="display: flex; padding: 14px 0">
          <div style="width: 140px; line-height: 32px; font-weight: bold; color: #000">{{ $t('币票互转') }}</div>
          <a-row :gutter="[0, 24]" style="width: calc(100% - 140px)">
            <a-col :span="24">
              <a-checkbox v-disable="'BisSysParameter:edit'" :disabled="isDisabled"
      @update:disabled="val => (isDisabled = val)" :checked="aCoinCoin.allowPoints == 'Y'" @change="(e) => changeSelectState(e, 'aCoinCoin', 'allowPoints', 2)">{{ $t('A币转币') }}</a-checkbox>
              <a-input-number
                v-model="aCoinCoin.points"
                style="width: 130px; margin-left: 10px"
                :disabled="aCoinCoin.allowPointsDisable"
                :step="0.1"
                :precision="1"
                :min="0.1"
                 v-disable="'BisSysParameterController:edit'"
                 @update:disabled="val => (aCoinCoin.allowPointsDisable = val)"
              />
              <span style="margin-left: 10px">{{ $t('A币等于1币') }}</span>
              <a-button type="primary" style="margin-left: 20px" @click="setACoinCoin(aCoinCoin)" v-has="'BisSysParameterController:edit'">{{
                $t('保存')
              }}</a-button>
            </a-col>
            <a-col :span="24">
              <a-checkbox :checked="coinACoin.state == 'Y'" @change="(e) => changeSelectState(e, 'coinACoin', 'state', 2)">{{ $t('币转A币') }}</a-checkbox>
              <i18n path="coinACoin" tag="span">
                <a-input-number
                  place="consumeAmount"
                  v-model="coinACoin.consumeAmount"
                  style="width: 130px; margin: 0 10px"
                  :disabled="coinACoin.state == 'N'"
                />
                <a-input-number
                  place="obtainIntegral"
                  v-model="coinACoin.obtainIntegral"
                  style="width: 130px; margin: 0 10px"
                  :disabled="coinACoin.state == 'N'"
                />
              </i18n>
              <a-button type="primary" style="margin-left: 20px" @click="save(coinACoin, coinACoin.state, 10)" v-has="'BisSysParameterController:edit'">{{
                $t('保存')
              }}</a-button>
            </a-col>
            <a-col :span="24">
              <a-checkbox :checked="ticketCoin.state == 'Y'" @change="(e) => changeSelectState(e, 'ticketCoin', 'state', 2)">{{ $t('票转币') }}</a-checkbox>
              <i18n path="ticketCoin" tag="span">
                <a-input-number
                  place="consumeAmount"
                  v-model="ticketCoin.consumeAmount"
                  style="width: 130px; margin: 0 10px"
                  :disabled="ticketCoin.state == 'N'"
                />
                <a-input-number
                  place="obtainIntegral"
                  v-model="ticketCoin.obtainIntegral"
                  style="width: 130px; margin: 0 10px"
                  :disabled="ticketCoin.state == 'N'"
                />
              </i18n>
              <a-button type="primary" style="margin-left: 20px" @click="save(ticketCoin, ticketCoin.state, 1)" v-has="'BisSysParameterController:edit'">{{
                $t('保存')
              }}</a-button>
            </a-col>
            <a-col :span="24">
              <a-checkbox :checked="coinLottery.state == 'Y'" @change="(e) => changeSelectState(e, 'coinLottery', 'state', 2)">{{ $t('币转票') }}</a-checkbox>
              <i18n path="coinLottery" tag="span">
                <a-input-number
                  place="consumeAmount"
                  v-model="coinLottery.consumeAmount"
                  style="width: 130px; margin: 0 10px"
                  :disabled="coinLottery.state == 'N'"
                />
                <a-input-number
                  place="obtainIntegral"
                  v-model="coinLottery.obtainIntegral"
                  style="width: 130px; margin: 0 10px"
                  :disabled="coinLottery.state == 'N'"
                />
              </i18n>
              <a-button type="primary" style="margin-left: 20px" @click="save(coinLottery, coinLottery.state, 6)" v-has="'BisSysParameterController:edit'">{{
                $t('保存')
              }}</a-button>
            </a-col>
            <a-col :span="24">
              <a-checkbox :checked="aLottoryCoin.state == 'Y'" @change="(e) => changeSelectState(e, 'aLottoryCoin', 'state', 2)">{{ $t('A票转币') }}</a-checkbox>
              <i18n path="aLottoryCoin" tag="span">
                <a-input-number
                  place="consumeAmount"
                  v-model="aLottoryCoin.consumeAmount"
                  style="width: 130px; margin: 0 10px"
                  :disabled="aLottoryCoin.state == 'N'"
                />
                <a-input-number
                  place="obtainIntegral"
                  v-model="aLottoryCoin.obtainIntegral"
                  style="width: 130px; margin: 0 10px"
                  :disabled="aLottoryCoin.state == 'N'"
                />
              </i18n>
              <a-button type="primary" style="margin-left: 20px" @click="save(aLottoryCoin, aLottoryCoin.state, 5)" v-has="'BisSysParameterController:edit'">{{
                $t('保存')
              }}</a-button>
            </a-col>
            <a-col :span="24">
              <a-checkbox :checked="coinALottery.state == 'Y'" @change="(e) => changeSelectState(e, 'coinALottery', 'state', 2)">{{ $t('币转A票') }}</a-checkbox>
              <i18n path="coinALottery" tag="span">
                <a-input-number
                  place="consumeAmount"
                  v-model="coinALottery.consumeAmount"
                  style="width: 130px; margin: 0 10px"
                  :disabled="coinALottery.state == 'N'"
                />
                <a-input-number
                  place="obtainIntegral"
                  v-model="coinALottery.obtainIntegral"
                  style="width: 130px; margin: 0 10px"
                  :disabled="coinALottery.state == 'N'"
                />
              </i18n>
              <a-button type="primary" style="margin-left: 20px" @click="save(coinALottery, coinALottery.state, 7)" v-has="'BisSysParameterController:edit'">{{
                $t('保存')
              }}</a-button>
            </a-col>
            <a-col :span="24">
              <a-checkbox :checked="lotteryACoin.state == 'Y'" @change="(e) => changeSelectState(e, 'lotteryACoin', 'state', 2)">{{ $t('票转A币') }}</a-checkbox>
              <i18n path="lotteryACoin" tag="span">
                <a-input-number
                  place="consumeAmount"
                  v-model="lotteryACoin.consumeAmount"
                  style="width: 130px; margin: 0 10px"
                  :disabled="lotteryACoin.state == 'N'"
                />
                <a-input-number
                  place="obtainIntegral"
                  v-model="lotteryACoin.obtainIntegral"
                  style="width: 130px; margin: 0 10px"
                  :disabled="lotteryACoin.state == 'N'"
                />
              </i18n>
              <a-button type="primary" style="margin-left: 20px" @click="save(lotteryACoin, lotteryACoin.state, 8)" v-has="'BisSysParameterController:edit'">{{
                $t('保存')
              }}</a-button>
            </a-col>
          </a-row>
        </div>
        <div style="display: flex; padding: 14px 0">
          <div style="width: 140px; line-height: 32px; font-weight: bold; color: #000">{{ $t('积分规则') }}</div>
          <a-row :gutter="[0, 24]" style="width: calc(100% - 140px)">
            <a-col :span="24">
              <a-checkbox :checked="integral.state == 'Y'" @change="(e) => changeSelectState(e, 'integral', 'state', 2)">{{ $t('积分规则') }}</a-checkbox>
              <i18n path="integral" tag="span">
                <a-input-number
                  place="consumeAmount"
                  v-model="integral.consumeAmount"
                  style="width: 130px; margin: 0 10px"
                  :disabled="integral.state == 'N'"
                />
                <a-input-number
                  place="obtainIntegral"
                  v-model="integral.obtainIntegral"
                  style="width: 130px; margin: 0 10px"
                  :disabled="integral.state == 'N'"
                />
              </i18n>
              <a-button type="primary" style="margin-left: 20px" @click="save(integral, integral.state, 0)" v-has="'BisSysParameterController:edit'">{{
                $t('保存')
              }}</a-button>
            </a-col>
            <a-col :span="24">
              <a-checkbox :checked="integralCoin.state == 'Y'" @change="(e) => changeSelectState(e, 'integralCoin', 'state', 2)">{{ $t('积分转币') }}</a-checkbox>
              <i18n path="integralCoin" tag="span">
                <a-input-number
                  place="consumeAmount"
                  v-model="integralCoin.consumeAmount"
                  style="width: 130px; margin: 0 10px"
                  :disabled="integralCoin.state == 'N'"
                />
                <a-input-number
                  place="obtainIntegral"
                  v-model="integralCoin.obtainIntegral"
                  style="width: 130px; margin: 0 10px"
                  :disabled="integralCoin.state == 'N'"
                />
              </i18n>
              <a-button type="primary" style="margin-left: 20px" @click="save(integralCoin, integralCoin.state, 2)" v-has="'BisSysParameterController:edit'">{{
                $t('保存')
              }}</a-button>
            </a-col>
            <a-col :span="24">
              <a-checkbox :checked="lotteryIntegral.state == 'Y'" @change="(e) => changeSelectState(e, 'lotteryIntegral', 'state', 2)">{{ $t('票转积分') }}</a-checkbox>
              <i18n path="lotteryIntegral" tag="span">
                <a-input-number
                  place="consumeAmount"
                  v-model="lotteryIntegral.consumeAmount"
                  style="width: 130px; margin: 0 10px"
                  :disabled="lotteryIntegral.state == 'N'"
                />
                <a-input-number
                  place="obtainIntegral"
                  v-model="lotteryIntegral.obtainIntegral"
                  style="width: 130px; margin: 0 10px"
                  :disabled="lotteryIntegral.state == 'N'"
                />
              </i18n>
              <a-button type="primary" style="margin-left: 20px" @click="save(lotteryIntegral, lotteryIntegral.state, 12)" v-has="'BisSysParameterController:edit'">{{
                $t('保存')
              }}</a-button>
            </a-col>
          </a-row>
        </div>
        <div style="display: flex; padding: 14px 0">
          <div style="width: 140px; line-height: 32px; font-weight: bold; color: #000">{{ $t('成长值规则') }}</div>
          <a-row :gutter="[0, 24]" style="width: calc(100% - 140px)">
            <a-col :span="24">
              <a-checkbox
                style="line-height: 32px"
                :checked="autoPromote.ivalue == 1"
                @change="(e) => changeSelectState(e, 'autoPromote', 'ivalue', 1, 'autoSave')"
                >{{ $t('自动晋级') }}</a-checkbox
              >
              <span style="margin-left: 15px; color: orange">{{
                $t('（开启后会员累计成长值达到设定的额度后会自动晋级）')
              }}</span>
            </a-col>
            <a-col :span="24">
              <a-checkbox :checked="growth.state == 'Y'" @change="(e) => changeSelectState(e, 'growth', 'state', 2)">{{ $t('充值') }}</a-checkbox>
              <i18n path="growth" tag="span">
                <a-input-number
                  place="consumeAmount"
                  v-model="growth.consumeAmount"
                  style="width: 130px; margin: 0 10px"
                  :disabled="growth.state == 'N'"
                  :step="0.1"
                  :precision="1"
                  :min="0.1"
                />
                <span place="obtainIntegral">{{ growth.obtainIntegral }}</span>
              </i18n>
              <a-button type="primary" style="margin-left: 20px" @click="save(growth, growth.state, 4)" v-has="'BisSysParameterController:edit'">{{
                $t('保存')
              }}</a-button>
            </a-col>
            <a-col :span="24">
              <a-checkbox :checked="lotteryGrowth.state == 'Y'" @change="(e) => changeSelectState(e, 'lotteryGrowth', 'state', 2)">{{ $t('存票') }}</a-checkbox>
              <i18n path="lotteryGrowth" tag="span">
                <a-input-number
                  place="consumeAmount"
                  v-model="lotteryGrowth.consumeAmount"
                  style="width: 130px; margin: 0 10px"
                  :disabled="lotteryGrowth.state == 'N'"
                  :step="1"
                  :min="0"
                />
                <span place="obtainIntegral">{{ lotteryGrowth.obtainIntegral }}</span>
              </i18n>
              <a-button type="primary" style="margin-left: 20px" @click="save(lotteryGrowth, lotteryGrowth.state, 9)" v-has="'BisSysParameterController:edit'">{{
                $t('保存')
              }}</a-button>
            </a-col>
          </a-row>
        </div>
        <div style="display: flex; padding: 14px 0">
          <div style="width: 140px; line-height: 32px; font-weight: bold; color: #000">{{ $t('其它规则') }}</div>
          <a-row :gutter="[0, 24]" style="width: calc(100% - 140px)">
            <a-col :span="24">
              <a-checkbox :checked="coinGift.state == 'Y'" @change="(e) => changeSelectState(e, 'coinGift', 'state', 2)">{{ $t('币兑礼品X') }}</a-checkbox>
              <i18n path="coinExGift" tag="span">
                <a-input-number
                  place="consumeAmount"
                  v-model="coinGift.consumeAmount"
                  style="width: 130px; margin: 0 10px"
                  :disabled="coinGift.state == 'N'"
                  :step="0.1"
                  :precision="1"
                  :min="0.1"
                />
                <a-input-number
                  place="obtainIntegral"
                  v-model="coinGift.obtainIntegral"
                  style="width: 130px; margin: 0 10px"
                  :disabled="coinGift.state == 'N'"
                />
              </i18n>
              <a-button type="primary" style="margin-left: 20px" @click="save(coinGift, coinGift.state, 11)" v-has="'BisSysParameterController:edit'">{{
                $t('保存')
              }}</a-button>
            </a-col>
          </a-row>
        </div>
      </a-tab-pane>
      <a-tab-pane key="2" :tab="$t('其它参数')" force-render>
        <div style="display: flex; padding: 14px 0">
          <div style="width: 140px; line-height: 32px; font-weight: bold; color: #000">{{ $t('门票设置') }}</div>
          <a-row :gutter="[0, 24]" style="width: calc(100% - 140px)">
            <a-col :span="24">
              <a-checkbox
                style="line-height: 32px"
                :checked="autoUseTicket.ivalue == 1"
                @change="(e) => changeSelectState(e, 'autoUseTicket', 'ivalue', 1, 'autoSave')"
                >{{ $t('自动验票') }}</a-checkbox
              >
              <span style="margin-left: 15px; color: orange">{{
                $t('（开启后吧台销售或兑换的单次门票将自动完成验票）')
              }}</span>
            </a-col>
            <a-col :span="24">
              <span>{{ $t('码类型') }}：</span>
              <a-select v-model="ticketPrintType.ivalue" style="width: 160px">
                <a-select-option value="0">{{ $t('条形码') }}</a-select-option>
                <a-select-option value="1">{{ $t('二维码') }}</a-select-option>
              </a-select>
              <a-button type="primary" style="margin-left: 20px" @click="parameterChange('ticketPrintType')" v-has="'BisSysParameterController:edit'">{{
                $t('保存')
              }}</a-button>
            </a-col>
            <a-col :span="24">
              <span>{{ $t('出票类型') }}：</span>
              <a-select v-model="ticketType.ivalue" style="width: 160px">
                <a-select-option value="0">{{ $t('打印门票') }}</a-select-option>
                <a-select-option value="1">{{ $t('印刷门票') }}</a-select-option>
                <a-select-option value="2">{{ $t('电子手环') }}</a-select-option>
              </a-select>
              <a-button type="primary" style="margin-left: 20px" @click="parameterChange('ticketType')" v-has="'BisSysParameterController:edit'">{{
                $t('保存')
              }}</a-button>
            </a-col>
            <a-col :span="24">
              <span>{{ $t('语音播报') }}：</span>
              <a-select v-model="gateLanguage.svalue" style="width: 160px">
                <a-select-option v-for="item in langList" :key="item.value" :value="item.value">{{
                  item.text
                }}</a-select-option>
              </a-select>
              <a-button type="primary" style="margin-left: 20px" @click="parameterChange('gateLanguage')" v-has="'BisSysParameterController:edit'">{{
                $t('保存')
              }}</a-button>
            </a-col>
          </a-row>
        </div>
        <div style="display: flex; padding: 14px 0">
          <div style="width: 140px; line-height: 32px; font-weight: bold; color: #000">{{ $t('消费限额') }}</div>
          <a-row :gutter="[0, 24]" style="width: calc(100% - 140px)">
            <a-col :span="24">
              <span>{{ $t('每人每日到店最大消费限额') }}</span>
              <a-input-number v-model="dayConsumeLimit.ivalue" style="margin: 0px 10px" :min="1" />
              <span>{{ $t('元') }}</span>
              <a-button type="primary" style="margin-left: 20px" @click="parameterChange('dayConsumeLimit')" v-has="'BisSysParameterController:edit'">{{
                $t('保存')
              }}</a-button>
            </a-col>
          </a-row>
        </div>
        <div style="display: flex; padding: 14px 0">
          <div style="width: 140px; line-height: 32px; font-weight: bold; color: #000">{{ $t('密码认证') }}</div>
          <a-row :gutter="[0, 24]" style="width: calc(100% - 140px)">
            <a-col :span="24">
              <a-checkbox
                style="line-height: 32px"
                :checked="closePwdForExCoin.ivalue == 1"
                @change="(e) => changeSelectState(e, 'closePwdForExCoin', 'ivalue', 1, 'autoSave')"
                >{{ $t('会员兑币') }}</a-checkbox
              >
              <a-checkbox
                style="line-height: 32px"
                :checked="closePwdForExGoods.ivalue == 1"
                @change="(e) => changeSelectState(e, 'closePwdForExGoods', 'ivalue', 1, 'autoSave')"
                >{{ $t('兑换商品') }}</a-checkbox
              >
              <a-checkbox
                style="line-height: 32px"
                :checked="closePwdForExTicket.ivalue == 1"
                @change="(e) => changeSelectState(e, 'closePwdForExTicket', 'ivalue', 1, 'autoSave')"
                >{{ $t('兑换门票') }}</a-checkbox
              >
              <a-checkbox
                style="line-height: 32px"
                :checked="checkPwdForDeductTicket.ivalue == 1"
                @change="(e) => changeSelectState(e, 'checkPwdForDeductTicket', 'ivalue', 1, 'autoSave')"
                >{{ $t('会员扣票') }}</a-checkbox
              >
              <a-checkbox
                style="line-height: 32px"
                :checked="closePwdForTransfer.ivalue == 1"
                @change="(e) => changeSelectState(e, 'closePwdForTransfer', 'ivalue', 1, 'autoSave')"
                >{{ $t('会员过户') }}</a-checkbox
              >
              <a-checkbox
                style="line-height: 32px"
                :checked="closePwdForExPackage.ivalue == 1"
                @change="(e) => changeSelectState(e, 'closePwdForExPackage', 'ivalue', 1, 'autoSave')"
                >{{ $t('兑换套餐') }}</a-checkbox
              >
              <a-checkbox
                style="line-height: 32px"
                :checked="checkPwdForDeductFee.ivalue == 1"
                @change="(e) => changeSelectState(e, 'checkPwdForDeductFee', 'ivalue', 1, 'autoSave')"
                >{{ $t('会员扣费') }}</a-checkbox
              >
            </a-col>
            <a-col :span="24" style="padding-top: 0">
              <span style="color: orange">{{ $t('（关闭后刷卡或扫描电子会员码进行业务将不再验证密码；但为了账户安全，无卡业务不受此开关控制必须验证密码）') }}</span>
            </a-col>
          </a-row>
        </div>
        <!-- <div style="display: flex; padding: 14px 0">
          <div style="width: 140px; line-height: 32px; font-weight: bold; color: #000">{{ $t('添加账户') }}</div>
          <a-row :gutter="[0, 24]" style="width: calc(100% - 140px)">
            <a-col :span="24">
              <a-checkbox :checked="addAccount.ivalue == 1" @change="(e) => changeSelectState(e, 'addAccount', 'ivalue', 1)">{{ $t('启用') }}</a-checkbox>
              <span style="margin-left: 10px">{{ $t('币值超过') }}</span>
              <a-input-number
                v-model="addAccount.svalue"
                style="width: 130px; margin-left: 10px"
                :disabled="addAccount.ivalue == 0"
                :min="1"
              />
              <span style="margin-left: 10px">{{ $t('需要授权') }}</span>
              <a-button type="primary" style="margin-left: 20px" @click="parameterChange('addAccount')">{{
                $t('保存')
              }}</a-button>
            </a-col>
          </a-row>
        </div> -->
        <div style="display: flex; padding: 14px 0">
          <div style="width: 140px; line-height: 32px; font-weight: bold; color: #000">{{ $t('消费二维码') }}</div>
          <a-row :gutter="[0, 24]" style="width: calc(100% - 140px)">
            <a-col :span="24">
              <a-checkbox
                style="line-height: 32px"
                :checked="deviceQrCode.ivalue == 1"
                @change="(e) => changeSelectState(e, 'deviceQrCode', 'ivalue', 1, 'autoSave')"
                >{{ $t('显示') }}</a-checkbox
              >
              <span style="margin-left: 15px; color: orange">{{ $t('（关闭后设备上将不再显示消费二维码）') }}</span>
            </a-col>
          </a-row>
        </div>
        <div style="display: flex; padding: 14px 0">
          <div style="width: 140px; line-height: 32px; font-weight: bold; color: #000">{{ $t('第三方核销') }}</div>
          <a-row :gutter="[0, 24]" style="width: calc(100% - 140px)">
            <a-col :span="24">
              <a-checkbox
                style="line-height: 32px"
                :checked="thirdOrderPrice.ivalue == 1"
                @change="(e) => changeSelectState2(e, 'thirdOrderPrice', 'ivalue', 1, 'autoSave')"
                >{{ $t('订单记账') }}</a-checkbox
              >
              <span style="margin-left: 15px; color: orange">{{
                $t('（开启后核销产生的订单中的相关金额将按第三方平台的订单金额进行记账；关闭后则订单金额记0）')
              }}</span>
            </a-col>
            <a-col :span="24">
              <a-checkbox
                style="line-height: 32px"
                :checked="thirdIncome.ivalue == 1"
                @change="(e) => changeSelectState1(e, 'thirdIncome', 'ivalue', 1, 'autoSave')"
                >{{ $t('首页记账') }}</a-checkbox
              >
              <span style="margin-left: 15px; color: orange">{{
                $t('（开启后订单首页的今日收款将包含第三方核销的收入）')
              }}</span>
            </a-col>
          </a-row>
        </div>
        <div style="display: flex; padding: 14px 0">
          <div style="width: 140px; line-height: 32px; font-weight: bold; color: #000">{{ $t('异业联盟') }}</div>
          <a-row :gutter="[0, 24]" style="width: calc(100% - 140px)">
            <a-col :span="2">
              <a-checkbox
                style="line-height: 32px"
                :checked="diffDeductCoin.ivalue == 1"
                @change="(e) => changeSelectState(e, 'diffDeductCoin', 'ivalue', 1, 'autoSave')"
                >{{ $t('币') }}</a-checkbox
              >
            </a-col>
            <a-col :span="2">
              <a-checkbox
                style="line-height: 32px"
                :checked="diffDeductLottery.ivalue == 1"
                @change="(e) => changeSelectState(e, 'diffDeductLottery', 'ivalue', 1, 'autoSave')"
                >{{ $t('彩票') }}</a-checkbox
              >
            </a-col>
            <a-col :span="2">
              <a-checkbox
                style="line-height: 32px"
                :checked="diffDeductACoin.ivalue == 1"
                @change="(e) => changeSelectState(e, 'diffDeductACoin', 'ivalue', 1, 'autoSave')"
                >{{ $t('A币') }}</a-checkbox
              >
            </a-col>
            <a-col :span="2">
              <a-checkbox
                style="line-height: 32px"
                :checked="diffDeductALottery.ivalue == 1"
                @change="(e) => changeSelectState(e, 'diffDeductALottery', 'ivalue', 1, 'autoSave')"
                >{{ $t('A票') }}</a-checkbox
              >
            </a-col>
            <a-col :span="14" style="line-height: 32px">
              <span style="margin-left: 15px; color: orange">{{ $t('（关闭后扣费界面不在展示该扣费项）') }}</span>
            </a-col>
          </a-row>
        </div>
        <div style="display: flex; padding: 14px 0">
          <div style="width: 140px; line-height: 32px; font-weight: bold; color: #000">{{ $t('安全提醒') }}</div>
          <a-row :gutter="[0, 24]" style="width: calc(100% - 140px)">
            <a-col :span="24">
              <a-checkbox v-model="addExpiryIvalues">{{ $t('启用') }}</a-checkbox>
              <i18n path="reminder-interval" tag="span" style="margin-left: 10px">
                <a-input-number
                  place="interval"
                  v-model="pwdExpiry.svalue"
                  style="width: 60px;"
                  :disabled="!addExpiryIvalues"
                  :min="1" />
              </i18n>
              <a-button type="primary" style="margin-left: 20px" @click="parameterChange('pwdExpiry')" v-has="'BisSysParameterController:edit'">
                {{ $t('保存')}}
              </a-button>
            </a-col>
          </a-row>
        </div>
        <div style="display: flex; padding: 14px 0">
          <div style="width: 140px; line-height: 32px; font-weight: bold; color: #000">{{ $t('经营钱包') }}</div>
          <a-row :gutter="[0, 24]" style="width: calc(100% - 140px)">
            <a-col :span="2">
              <a-checkbox
                style="line-height: 32px"
                v-model="operateCoin.ivalues"
                @change="parameterChange('operateCoin')"
                >{{ $t('币') }}</a-checkbox
              >
            </a-col>
            <a-col :span="2">
              <a-checkbox
                style="line-height: 32px"
                v-model="operateLottery.ivalues"
                @change="parameterChange('operateLottery')"
                >{{ $t('彩票') }}</a-checkbox
              >
            </a-col>
            <a-col :span="2">
              <a-checkbox
                style="line-height: 32px"
                v-model="operateACoin.ivalues"
                @change="parameterChange('operateACoin')"
                >{{ $t('A币') }}</a-checkbox
              >
            </a-col>
            <a-col :span="2">
              <a-checkbox
                style="line-height: 32px"
                v-model="operateALottery.ivalues"
                @change="parameterChange('operateALottery')"
                >{{ $t('A票') }}</a-checkbox
              >
            </a-col>
            <a-col :span="2">
              <a-checkbox
                style="line-height: 32px"
                v-model="operateCredit.ivalues"
                @change="parameterChange('operateCredit')"
                >{{ $t('积分') }}</a-checkbox
              >
            </a-col>
            <a-col :span="2">
              <a-checkbox
                style="line-height: 32px"
                v-model="operateGrowth.ivalues"
                @change="parameterChange('operateGrowth')"
                >{{ $t('成长值') }}</a-checkbox
              >
            </a-col>
            <a-col :span="12" style="line-height: 32px">
              <span style="margin-left: 15px; color: orange">{{
                $t('（经营上用不到的账户钱包可关闭，关闭后相关功能将不再展示对应的数据项）')
              }}</span>
            </a-col>
          </a-row>
        </div>
        <div style="display: flex; padding: 14px 0">
          <div style="width: 140px; line-height: 32px; font-weight: bold; color: #000">{{ $t('清币管理') }}</div>
          <a-row :gutter="[0, 24]" style="width: calc(100% - 140px)">
            <a-col :span="24">
              <a-checkbox
                style="line-height: 32px"
                :checked="coinClearAdd.ivalue == 1"
                @change="(e) => changeSelectState1(e, 'coinClearAdd', 'ivalue', 1, 'autoSave')"
                >{{ $t('清币后自动加币') }}</a-checkbox
              >
              <span style="margin-left: 15px; color: orange">{{
                $t('（吧台或兑币机执行清币操作后系统按清币数量自动加币）')
              }}</span>
            </a-col>
          </a-row>
        </div>
      </a-tab-pane>
      <a-tab-pane key="3" :tab="$t('吧台运营参数')" force-render>
        <div style="display: flex; padding: 14px 0">
          <div style="width: 140px; line-height: 32px; font-weight: bold; color: #000">{{ $t('结账显示应收') }}</div>
          <a-row :gutter="[0, 24]" style="width: calc(100% - 140px)">
            <a-col :span="24">
              <a-checkbox style="line-height: 32px" :checked="checkOutReceivable.ivalue == 1"
                @change="(e) => changeSelectState(e, 'checkOutReceivable', 'ivalue', 1, 'autoSave')">
                {{ $t('启用') }}
              </a-checkbox>
              <span style="margin-left: 15px; color: orange">{{
                $t('（开启后吧员在交班结账时将显示系统的应收金额）')
              }}</span>
            </a-col>
          </a-row>
        </div>
        <div style="display: flex; padding: 14px 0">
          <div style="width: 140px; line-height: 32px; font-weight: bold; color: #000">{{ $t('会员注册') }}</div>
          <a-row :gutter="[0, 24]" style="width: calc(100% - 140px)">
            <a-col :span="24">
              <a-checkbox style="line-height: 32px" :checked="memberPhoneLimit.ivalue == 1"
                @change="(e) => changeSelectState(e, 'memberPhoneLimit', 'ivalue', 1, 'autoSave')">
                {{ $t('一个手机号只允许注册一个会员') }}
              </a-checkbox>
              <a-checkbox style="line-height: 32px; margin-left: 10px" :checked="memberCertLimit.ivalue == 1"
                @change="(e) => changeSelectState(e, 'memberCertLimit', 'ivalue', 1, 'autoSave')">
                {{ $t('一个证件号只允许注册一个会员') }}
              </a-checkbox>
            </a-col>
          </a-row>
        </div>
        <div style="display: flex; padding: 14px 0">
          <div style="width: 140px; line-height: 32px; font-weight: bold; color: #000">{{ $t('宝盒启动') }}</div>
          <a-row :gutter="[0, 24]" style="width: calc(100% - 140px)">
            <a-col :span="24">
              <a-checkbox style="line-height: 32px" :checked="barReaderControl.ivalue == 1"
                @change="(e) => changeSelectState(e, 'barReaderControl', 'ivalue', 1, 'autoSave')">{{ $t('启用') }}</a-checkbox>
              <span style="margin-left: 15px; color: orange">
                {{ $t('（启用后吧台无宝盒不允许启动）') }}
              </span>
            </a-col>
          </a-row>
        </div>
        <div style="display: flex; padding: 14px 0">
          <div style="width: 140px; line-height: 32px; font-weight: bold; color: #000">{{ $t('账号密码登录') }}</div>
          <a-row :gutter="[0, 24]" style="width: calc(100% - 140px)">
            <a-col :span="24">
              <a-checkbox style="line-height: 32px" :checked="barAccountLogin.ivalue == 1"
                @change="(e) => changeSelectState(e, 'barAccountLogin', 'ivalue', 1, 'autoSave')">{{ $t('启用') }}</a-checkbox>
              <span style="margin-left: 15px; color: orange">
                {{ $t('（关闭后吧台的登录方式不再支持账号密码登录）') }}
              </span>
            </a-col>
          </a-row>
        </div>
        <div style="display: flex; padding: 14px 0">
          <div style="width: 140px; line-height: 32px; font-weight: bold; color: #000">{{ $t('图文验证') }}</div>
          <a-row :gutter="[0, 24]" style="width: calc(100% - 140px)">
            <a-col :span="24">
              <a-checkbox style="line-height: 32px" :checked="barImageVerify.ivalue == 1"
                @change="(e) => changeSelectState(e, 'barImageVerify', 'ivalue', 1, 'autoSave')">{{ $t('启用')}}</a-checkbox>
              <span style="margin-left: 15px; color: orange">
                {{ $t('（启用后吧台使用账号密码登录时需要进行图文认证）') }}
              </span>
            </a-col>
          </a-row>
        </div>
        <div style="display: flex; padding: 14px 0">
          <div style="width: 140px; line-height: 32px; font-weight: bold; color: #000">{{ $t('默认密码开卡') }}</div>
          <a-row :gutter="[0, 24]" style="width: calc(100% - 140px)">
            <a-col :span="24">
              <a-checkbox v-model="defaultPwdIvalues">{{ $t('启用') }}</a-checkbox>
              <span style="margin-left: 10px">{{ $t('默认密码：') }}</span>
              <a-input-password 
                v-model="defaultPwd.svalue" 
                style="width: 200px; margin-left: 10px" 
                :maxLength="6" 
                :placeholder="$t('请输入6位数字消费密码')"
                :disabled="!defaultPwdIvalues"/>
              <a-button type="primary" style="margin-left: 20px" @click="parameterChange('defaultPwd')"
                v-has="'BisSysParameterController:edit'">
                {{ $t('保存') }}
              </a-button>
              <span style="margin-left: 15px; color: orange">
                {{ $t('（开启此功能后吧台注册开卡时将无需再设置会员消费密码，直接使用默认密码快捷开卡）') }}
              </span>
            </a-col>
          </a-row>
        </div>
        <div style="display: flex; padding: 14px 0">
          <div style="width: 140px; line-height: 32px; font-weight: bold; color: #000">{{ $t('开卡赠送') }}</div>
          <a-row :gutter="[0, 24]" style="width: calc(100% - 140px)">
            <a-col :span="24">
              <span>{{ $t('代币') }}</span>
              <a-input-number
                v-model="cardCoin.ivalue"
                style="width: 130px; margin-right: 10px; margin-left: 3px"
                :precision="0"
                :min="0"
                :max="99999999"
              />
              <span>{{ $t('彩票') }}</span>
              <a-input-number
                v-model="cardLottery.ivalue"
                style="width: 130px; margin-right: 10px; margin-left: 3px"
                :precision="0"
                :min="0"
                :max="99999999"
              />
              <span>{{ $t('积分') }}</span>
              <a-input-number
                v-model="cardIntegral.ivalue"
                style="width: 130px; margin-right: 10px; margin-left: 3px"
                :precision="0"
                :min="0"
                :max="99999999"
              />
              <span>{{ $t('A币') }}</span>
              <a-input-number
                v-model="cardACoin.ivalue"
                style="width: 130px; margin-right: 10px; margin-left: 3px"
                :precision="0"
                :min="0"
                :max="99999999"
              />
              <span>{{ $t('A票') }}</span>
              <a-input-number
                v-model="cardALottery.ivalue"
                style="width: 130px; margin-right: 10px; margin-left: 3px"
                :precision="0"
                :min="0"
                :max="99999999"
              />
              <a-button type="primary" style="margin-left: 20px" @click="presentRuleChange()" v-has="'BisSysParameterController:edit'">{{ $t('保存') }}</a-button>
            </a-col>
          </a-row>
        </div>
      </a-tab-pane>
    </a-tabs>
  </a-card>
</template>

<script>
import Vue from 'vue'
import moment from 'moment'
import { getAction, httpAction, putAction } from '@/api/manage'
import { cronChangeDate, dateChangeCron } from '@/utils/cronDate'
import axios from 'axios'

export default {
  name: 'OperationSetting',
  components: {},
  data() {
    return {
      disable: false,
      description: '运营设置',
      actKey: '1',
      checkId: '',
      checkTime: '',
      checkState: false,
      timeInfo: {},
      time: {
        name: 'startTime',
        svalue: '',
        type: '',
      },
      currencySymbol: {
        name: 'currencySymbol',
        svalue: '￥',
        comment: '金额符号',
      },
      integral: {},
      ticketCoin: {
        consumeAmount: '',
      },
      coinGift: {
        state: 'N',
        consumeAmount: 1,
        obtainIntegral: 1,
      },
      coinLottery: {},
      integralCoin: {
        consumeAmount: 1,
        obtainIntegral: 1,
      },
      lotteryIntegral: {
        state: 'N',
        consumeAmount: 1,
        obtainIntegral: 1,
      },
      growth: {
        obtainIntegral: 1,
      },
      lotteryGrowth: {
        obtainIntegral: 1,
      },
      aLottoryCoin: {
        consumeAmount: 1,
        obtainIntegral: 1,
      },
      coinALottery: {
        consumeAmount: 1,
        obtainIntegral: 1,
      },
      lotteryACoin: {
        consumeAmount: 1,
        obtainIntegral: 1,
      },
      coinACoin: {
        consumeAmount: 1,
        obtainIntegral: 1,
      },
      aCoinCoin: {
        allowPoints: 'N',
        points: 1,
      },
      thousandsSeparator: {
        name: 'thousandsSeparator',
        ivalue: 0,
        comment: '千位分隔符',
      },
      autoUseTicket: {
        name: 'autoUseTicket',
        ivalue: 1,
        comment: '自动验票',
      },
      checkOutReceivable: {
        name: 'checkOutReceivable',
        ivalue: 0,
        comment: '结账显示应收',
      },
      registerCheckIdCard: {
        name: 'registerCheckIdCard',
        ivalues: false,
        ivalue: 0,
        comment: '注册验实卡',
      },
      dayConsumeLimit: {
        name: 'dayConsumeLimit',
        ivalue: 1500,
        comment: '每人每日到店最大消费限额',
      },
      closePwdForExCoin: {
        name: 'closePwdForExCoin',
        ivalue: 1,
        comment: '密码认证-会员兑币',
      },
      closePwdForExGoods: {
        name: 'closePwdForExGoods',
        ivalue: 1,
        comment: '密码认证-兑换卖品',
      },
      closePwdForExTicket: {
        name: 'closePwdForExTicket',
        ivalue: 1,
        comment: '密码认证-兑换门票',
      },
      checkPwdForDeductTicket: {
        name: 'checkPwdForDeductTicket',
        ivalue: 1,
        comment: '密码认证-会员扣票',
      },
      checkPwdForDeductFee: {
        name: 'checkPwdForDeductFee',
        ivalue: 0,
        comment: '密码认证-会员扣费',
      },
      closePwdForTransfer: {
        name: 'closePwdForTransfer',
        ivalue: 1,
        comment: '密码认证-会员过户',
      },
      closePwdForExPackage: {
        name: 'closePwdForExPackage',
        ivalue: 1,
        comment: '密码认证-兑换套餐',
      },
      addAccount: {
        name: 'addAccount',
        ivalue: 1,
        svalue: 1000,
        comment: '增加账户是否需要授权',
      },
      pwdExpiry: {
        name: 'pwdExpiry',
        ivalue: 1,
        svalue: 6,
        comment: '定期提醒更改密码',
      },
      deviceQrCode: {
        name: 'deviceQrCode',
        ivalue: 1,
        comment: '消费二维码',
      },
      autoPromote: {
        name: 'autoPromote',
        ivalue: 0,
        comment: '自动晋级',
      },
      thirdOrderPrice: {
        name: 'thirdOrderPrice',
        ivalue: 1,
        comment: '第三方核销-订单记账',
      },
      thirdIncome: {
        name: 'thirdIncome',
        ivalue: 0,
        comment: '第三方核销-首页记账',
      },
      coinClearAdd: {
        name: 'coinClearAdd',
        ivalue: 0,
        comment: '清币管理-清币后自动加币',
      },
      diffDeductCoin: {
        name: 'diffDeductCoin',
        ivalue: 1,
        comment: '异业扣费-币',
      },
      diffDeductLottery: {
        name: 'diffDeductLottery',
        ivalue: 1,
        comment: '异业扣费-彩票',
      },
      diffDeductACoin: {
        name: 'diffDeductACoin',
        ivalue: 1,
        comment: '异业扣费-A币',
      },
      diffDeductALottery: {
        name: 'diffDeductALottery',
        ivalue: 1,
        comment: '异业扣费-A票',
      },
      operateCoin: {
        name: 'operateCoin',
        ivalues: true,
        ivalue: 1,
        comment: '经营钱包-币',
      },
      operateLottery: {
        name: 'operateLottery',
        ivalues: true,
        ivalue: 1,
        comment: '经营钱包-彩票',
      },
      operateACoin: {
        name: 'operateACoin',
        ivalues: true,
        ivalue: 1,
        comment: '经营钱包-A币',
      },
      operateALottery: {
        name: 'operateALottery',
        ivalues: true,
        ivalue: 1,
        comment: '经营钱包-A票',
      },
      operateCredit: {
        name: 'operateCredit',
        ivalues: true,
        ivalue: 1,
        comment: '经营钱包-积分',
      },
      operateGrowth: {
        name: 'operateGrowth',
        ivalues: true,
        ivalue: 1,
        comment: '经营钱包-成长值',
      },
      memberPhoneLimit: {
        name: 'memberPhoneLimit',
        ivalue: 0,
        comment: '会员注册-一个手机号只能注册一个会员',
      },
      memberCertLimit: {
        name: 'memberCertLimit',
        ivalue: 0,
        comment: '会员注册-一个证件号只能注册一个会员',
      },
      ticketPrintType: {
        name: 'ticketPrintType',
        ivalue: '0',
        comment: '门票-码类型',
      },
      ticketType: {
        name: 'ticketType',
        ivalue: '0',
        comment: '门票-出票类型',
      },
      gateLanguage: {
        name: 'gateLanguage',
        svalue: 'zh-CN',
        comment: '闸机语言',
      },
      barReaderControl: {
        name: 'barReaderControl',
        ivalue: 1,
        comment: '吧台-无宝盒不允许启用',
      },
      barAccountLogin: {
        name: 'barAccountLogin',
        ivalue: 1,
        comment: '吧台-启用账号密码登录',
      },
      barImageVerify: {
        name: 'barImageVerify',
        ivalue: 0,
        comment: '吧台-启用登录图文认证',
      },
      defaultPwd: {
        name: 'defaultPwd',
        ivalue: 0,
        comment: '默认密码开卡',
      },
      cardCoin: {
        name: 'cardCoin',
        ivalue: 0,
        comment: '开卡赠送-代币',
      },
      cardLottery: {
        name: 'cardLottery',
        ivalue: 0,
        comment: '开卡赠送-彩票',
      },
      cardIntegral: {
        name: 'cardIntegral',
        ivalue: 0,
        comment: '开卡赠送-积分',
      },
      cardACoin: {
        name: 'cardACoin',
        ivalue: 0,
        comment: '开卡赠送-A币',
      },
      cardALottery: {
        name: 'cardALottery',
        ivalue: 0,
        comment: '开卡赠送-A票',
      },
      langList: [
        {
          value: 'zh-CN',
          text: this.$t('中文'),
        },
        {
          value: 'en-US',
          text: this.$t('英文'),
        },
      ],
      url: {
        add: '/order/bisMemberAccoutRule/add',
        edit: '/order/bisMemberAccoutRule/edit',
      },
      addExpiryIvalues: true,
      defaultPwdIvalues: true,
      isDisabled: false
    }
  },
  created() {
    this.getTime()
    this.getRule()
    this.getACoinCoin()
    this.getParameter('currencySymbol')
    this.getParameter('autoUseTicket')
    this.getParameter('checkOutReceivable')
    this.getParameter('dayConsumeLimit')
    this.getParameter('closePwdForExCoin')
    this.getParameter('closePwdForExGoods')
    this.getParameter('closePwdForExTicket')
    this.getParameter('checkPwdForDeductTicket')
    this.getParameter('checkPwdForDeductFee')
    this.getParameter('closePwdForTransfer')
    this.getParameter('closePwdForExPackage')
    //this.getParameter('addAccount')
    this.getParameter('pwdExpiry')
    this.getParameter('deviceQrCode')
    this.getParameter('autoPromote')
    this.getParameter('thirdOrderPrice')
    this.getParameter('thirdIncome')
    this.getParameter('coinClearAdd')
    this.getParameter('diffDeductCoin')
    this.getParameter('diffDeductLottery')
    this.getParameter('diffDeductACoin')
    this.getParameter('diffDeductALottery')
    this.getParameter('operateCoin')
    this.getParameter('operateLottery')
    this.getParameter('operateACoin')
    this.getParameter('operateALottery')
    this.getParameter('operateCredit')
    this.getParameter('operateGrowth')
    this.getParameter('memberPhoneLimit')
    this.getParameter('memberCertLimit')
    this.getParameter('ticketPrintType')
    this.getParameter('ticketType')
    this.getParameter('gateLanguage')
    this.getParameter('thousandsSeparator')
    this.getParameter('barReaderControl')
    this.getParameter('barAccountLogin')
    this.getParameter('barImageVerify')
    this.getParameter('defaultPwd')
    this.getPresentRule()
    this.getCheckParam()
  },
  computed: {
    importExcelUrl: function () {
      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
    },
  },
  methods: {
    handleDisableStatus(val, val1){
      //let bol = val1 == 'N' ? true : false
      val1 = (val ? 'N' : 'Y')
    },
    callback(e) {
      this.actKey = e
    },
    getACoinCoin() {
      getAction('/goods/bisGoodsInfor/getReplaceCoin').then((res) => {
        if (res.success) {
          this.aCoinCoin = res.result
          this.aCoinCoin.allowPointsDisable = this.aCoinCoin.allowPoints == 'N' ? true : false
        }
      })
    },
    setACoinCoin(item) {
      putAction('/goods/bisGoodsInfor/edit', item).then((res) => {
        if (res.success) {
          this.$message.success(res.message)
          this.getACoinCoin()
        }
      })
    },
    queryByName(name) {
      return getAction('/bis/bisSysParameter/queryByName', { name: name })
    },
    initDictConfig() {},
    async getTime() {
      let obj = await this.getJobInfo('org.jeecg.modules.business.quartz.job.MemberReportJob')
      this.timeInfo = obj
      getAction('/bis/bisSysParameter/list', { name: 'startTime' }).then((res) => {
        if (res.success) {
          if (res.result.records.length > 0) {
            this.time = res.result.records[0]
          } else {
            this.time.svalue = '00:00:00'
          }
        }
      })
    },
    getRule() {
      getAction('/order/bisMemberAccoutRule/list', { pageSize: 99 }).then((res) => {
        if (res.success) {
          res.result.records.forEach((col) => {
            if (col.type == 0) {
              this.integral = col
              return
            }
            if (col.type == 1) {
              this.ticketCoin = col
              return
            }
            if (col.type == 2) {
              this.integralCoin = col
              return
            }
            if (col.type == 4) {
              this.growth = col
              return
            }
            if (col.type == 5) {
              this.aLottoryCoin = col
              return
            }
            if (col.type == 6) {
              this.coinLottery = col
              return
            }
            if (col.type == 7) {
              this.coinALottery = col
              return
            }
            if (col.type == 8) {
              this.lotteryACoin = col
              return
            }
            if (col.type == 9) {
              this.lotteryGrowth = col
              return
            }
            if (col.type == 10) {
              this.coinACoin = col
              return
            }
            if (col.type == 11) {
              this.coinGift = col
              return
            }
            if (col.type == 12) {
              this.lotteryIntegral = col
              return
            }
          })
        }
      })
    },
    timeSave() {
      let querydata = {}
      querydata = Object.assign({}, this.time)
      if (this.time.svalue == null) {
        this.$message.warning(this.$t('值不能为空'))
        return
      }
      let url = ''
      let method = ''
      if (this.time.id) {
        url = '/bis/bisSysParameter/edit'
        method = 'put'
      } else {
        url = '/bis/bisSysParameter/add'
        method = 'post'
      }
      httpAction(url, querydata, method).then((res) => {
        if (res.success) {
          this.saveJob('org.jeecg.modules.business.quartz.job.MemberReportJob', Object.assign(this.timeInfo, {time: this.time.svalue}))
          this.$message.success(res.message)
        } else {
          this.$message.warning(res.message)
        }
      })
    },
    save(record, state, type) {
      if (state == 'Y') {
        if (record.consumeAmount == null || record.obtainIntegral == null) {
          this.$message.warning(this.$t('值不能为空'))
          return
        }
        if (record.consumeAmount < 0 || record.obtainIntegral < 0) {
          this.$message.warning(this.$t('值不能小于0'))
          return
        }
        if (record.consumeAmount == 0 || record.obtainIntegral == 0) {
          this.$message.warning(this.$t('值不能为0'))
          return
        }
        if (type != 3 && type != 4 && type != 11 && (record.consumeAmount % 1 != 0 || record.obtainIntegral % 1 != 0)) {
          this.$message.warning(this.$t('值不能为小数'))
          return
        }
      }else{
        record.state = 'N'
      }
      record.type = type
      let url = ''
      let method = ''
      if (record.id) {
        url = this.url.edit
        method = 'put'
      } else {
        url = this.url.add
        method = 'post'
      }
      httpAction(url, record, method).then((res) => {
        if (res.success) {
          this.$message.success(res.message)
          this.getRule()
        } else {
          this.$message.warning(res.message)
        }
      })
    },
    getParameter(name) {
      getAction('/bis/bisSysParameter/list', { name: name }).then((res) => {
        if (res.success) {
          if (res.result.records.length > 0) {
            if (name === 'currencySymbol') {
              this.currencySymbol = res.result.records[0]
            }
            if (name === 'autoUseTicket') {
              this.autoUseTicket = res.result.records[0]
            }
            if (name === 'checkOutReceivable') {
              this.checkOutReceivable = res.result.records[0]
            }
            if (name === 'registerCheckIdCard') {
              this.registerCheckIdCard = res.result.records[0]
              this.registerCheckIdCard.ivalues = this.registerCheckIdCard.ivalue ? true : false
            }
            if (name === 'dayConsumeLimit') {
              this.dayConsumeLimit = res.result.records[0]
            }
            if (name === 'closePwdForExCoin') {
              this.closePwdForExCoin = res.result.records[0]
            }
            if (name === 'closePwdForExGoods') {
              this.closePwdForExGoods = res.result.records[0]
            }
            if (name === 'closePwdForExTicket') {
              this.closePwdForExTicket = res.result.records[0]
            }
            if (name === 'checkPwdForDeductTicket') {
              this.checkPwdForDeductTicket = res.result.records[0]
            }
            if (name === 'checkPwdForDeductFee') {
              this.checkPwdForDeductFee = res.result.records[0]
            }
            if (name === 'closePwdForTransfer') {
              this.closePwdForTransfer = res.result.records[0]
            }
            if (name === 'closePwdForExPackage') {
              this.closePwdForExPackage = res.result.records[0]
            }
            /* if (name === 'addAccount') {
              this.addAccount = res.result.records[0]
            } */
            if (name === 'pwdExpiry') {
              this.pwdExpiry = res.result.records[0]
              this.addExpiryIvalues = this.pwdExpiry.ivalue ? true : false
            }
            if (name === 'deviceQrCode') {
              this.deviceQrCode = res.result.records[0]
            }
            if (name === 'autoPromote') {
              this.autoPromote = res.result.records[0]
            }
            if (name === 'thirdOrderPrice') {
              this.thirdOrderPrice = res.result.records[0]
            }
            if (name === 'thirdIncome') {
              this.thirdIncome = res.result.records[0]
            }
            if (name === 'coinClearAdd') {
              this.coinClearAdd = res.result.records[0]
            }
            if (name === 'diffDeductCoin') {
              this.diffDeductCoin = res.result.records[0]
            }
            if (name === 'diffDeductLottery') {
              this.diffDeductLottery = res.result.records[0]
            }
            if (name === 'diffDeductACoin') {
              this.diffDeductACoin = res.result.records[0]
            }
            if (name === 'diffDeductALottery') {
              this.diffDeductALottery = res.result.records[0]
            }
            if (name === 'operateCoin') {
              this.operateCoin = res.result.records[0]
              this.operateCoin.ivalues = this.operateCoin.ivalue ? true : false
            }
            if (name === 'operateLottery') {
              this.operateLottery = res.result.records[0]
              this.operateLottery.ivalues = this.operateLottery.ivalue ? true : false
            }
            if (name === 'operateACoin') {
              this.operateACoin = res.result.records[0]
              this.operateACoin.ivalues = this.operateACoin.ivalue ? true : false
            }
            if (name === 'operateALottery') {
              this.operateALottery = res.result.records[0]
              this.operateALottery.ivalues = this.operateALottery.ivalue ? true : false
            }
            if (name === 'operateCredit') {
              this.operateCredit = res.result.records[0]
              this.operateCredit.ivalues = this.operateCredit.ivalue ? true : false
            }
            if (name === 'operateGrowth') {
              this.operateGrowth = res.result.records[0]
              this.operateGrowth.ivalues = this.operateGrowth.ivalue ? true : false
            }
            if (name === 'memberPhoneLimit') {
              this.memberPhoneLimit = res.result.records[0]
            }
            if (name === 'memberCertLimit') {
              this.memberCertLimit = res.result.records[0]
            }
            if (name === 'ticketPrintType') {
              this.ticketPrintType = res.result.records[0]
              this.ticketPrintType.ivalue = '' + this.ticketPrintType.ivalue
            }
            if (name === 'ticketType') {
              this.ticketType = res.result.records[0]
              this.ticketType.ivalue = '' + this.ticketType.ivalue
            }
            if (name === 'gateLanguage') {
              this.gateLanguage = res.result.records[0]
            }
            if (name === 'thousandsSeparator'){
              this[name] =  res.result.records[0]
            }
            if (name === 'barReaderControl'){
              this[name] =  res.result.records[0]
            }
            if (name === 'barAccountLogin'){
              this[name] =  res.result.records[0]
            }
            if (name === 'barImageVerify'){
              this[name] =  res.result.records[0]
            }
            if (name === 'defaultPwd') {
              this.defaultPwd = res.result.records[0]
              this.defaultPwdIvalues = this.defaultPwd.ivalue ? true : false
            }
          } else {
            if (name === 'currencySymbol') {
              this.currencySymbol.svalue = "￥"
            }
            if (name === 'autoUseTicket') {
              this.autoUseTicket.ivalue = 1
            }
            if (name === 'checkOutReceivable') {
              this.checkOutReceivable.ivalue = 1
            }
            if (name === 'registerCheckIdCard') {
              this.registerCheckIdCard.ivalues = false
            }
            if (name === 'dayConsumeLimit') {
              this.dayConsumeLimit.ivalue = 1500
            }
            if (name === 'closePwdForExCoin') {
              this.closePwdForExCoin.ivalue = 1
            }
            if (name === 'closePwdForExGoods') {
              this.closePwdForExGoods.ivalue = 1
            }
            if (name === 'closePwdForExTicket') {
              this.closePwdForExTicket.ivalue = 1
            }
            if (name === 'checkPwdForDeductTicket') {
              this.checkPwdForDeductTicket.ivalue = 1
            }
            if (name === 'closePwdForTransfer') {
              this.closePwdForTransfer.ivalue = 1
            }
            if (name === 'closePwdForExPackage') {
              this.closePwdForExPackage.ivalue = 1
            }
            if (name === 'checkPwdForDeductFee') {
              this.checkPwdForDeductFee.ivalue = 0
            }
            /* if (name === 'addAccount') {
              this.addAccount.ivalue = 1
            } */
            if (name === 'pwdExpiry') {
              this.addExpiryIvalues = true
            }
            if (name === 'deviceQrCode') {
              this.deviceQrCode.ivalue = 1
            }
            if (name === 'autoPromote') {
              this.autoPromote.ivalue = 0
            }
            if (name === 'thirdOrderPrice') {
              this.thirdOrderPrice.ivalue = 1
            }
            if (name === 'thirdIncome') {
              this.thirdIncome.ivalue = 0
            }
            if (name === 'coinClearAdd') {
              this.coinClearAdd.ivalue = 0
            }
            if (name === 'diffDeductCoin') {
              this.diffDeductCoin.ivalue = 1
            }
            if (name === 'diffDeductLottery') {
              this.diffDeductLottery.ivalue = 1
            }
            if (name === 'diffDeductACoin') {
              this.diffDeductACoin.ivalue = 1
            }
            if (name === 'diffDeductALottery') {
              this.diffDeductALottery.ivalue = 1
            }
            if (name === 'operateCoin') {
              this.operateCoin.ivalues = true
            }
            if (name === 'operateLottery') {
              this.operateLottery.ivalues = true
            }
            if (name === 'operateACoin') {
              this.operateACoin.ivalues = true
            }
            if (name === 'operateALottery') {
              this.operateALottery.ivalues = true
            }
            if (name === 'operateCredit') {
              this.operateCredit.ivalues = true
            }
            if (name === 'operateGrowth') {
              this.operateGrowth.ivalues = true
            }
            if (name === 'memberPhoneLimit') {
              this.memberPhoneLimit.ivalue = 0
            }
            if (name === 'memberCertLimit') {
              this.memberCertLimit.ivalue = 0
            }
            if (name === 'ticketPrintType') {
              this.ticketPrintType.ivalue = '0'
            }
            if (name === 'ticketType') {
              this.ticketType.ivalue = '0'
            }
            if (name === 'gateLanguage') {
              this.gateLanguage.svalue = 'zh-CN'
            }
            if (name === 'thousandsSeparator'){
              this.thousandsSeparator.ivalue =  0
            }
            if (name === 'barReaderControl'){
              this.barReaderControl.ivalue = 1
            }
            if (name === 'barAccountLogin'){
              this.barAccountLogin.ivalue = 1
            }
            if (name === 'barImageVerify'){
              this.barImageVerify.ivalue = 0
            }
            if (name === 'defaultPwd') {
              this.defaultPwdIvalues = false
            }
          }
          if (name === 'operateCoin') {
            localStorage.setItem('operateCoin', this.operateCoin.ivalues ? 1 : 0)
          }
          if (name === 'operateLottery') {
            localStorage.setItem('operateLottery', this.operateLottery.ivalues ? 1 : 0)
          }
          if (name === 'operateACoin') {
            localStorage.setItem('operateACoin', this.operateACoin.ivalues ? 1 : 0)
          }
          if (name === 'operateALottery') {
            localStorage.setItem('operateALottery', this.operateALottery.ivalues ? 1 : 0)
          }
          if (name === 'operateCredit') {
            localStorage.setItem('operateCredit', this.operateCredit.ivalues ? 1 : 0)
          }
          if (name === 'operateGrowth') {
            localStorage.setItem('operateGrowth', this.operateGrowth.ivalues ? 1 : 0)
          }
          if (name === 'thousandsSeparator') {
            localStorage.setItem('thousandsSeparator', this.thousandsSeparator.ivalue);

          }
        }
      })
    },
    parameterChange(name) {
      let that = this, querydata = {}
      let url = '', method = ''
      if (
        (name === 'currencySymbol' && that.currencySymbol.id) ||
        (name === 'autoUseTicket' && that.autoUseTicket.id) ||
        (name === 'checkOutReceivable' && that.checkOutReceivable.id) ||
        (name === 'registerCheckIdCard' && that.registerCheckIdCard.id) ||
        (name === 'dayConsumeLimit' && that.dayConsumeLimit.id) ||
        (name === 'closePwdForExCoin' && that.closePwdForExCoin.id) ||
        (name === 'closePwdForExGoods' && that.closePwdForExGoods.id) ||
        (name === 'closePwdForExTicket' && that.closePwdForExTicket.id) ||
        (name === 'checkPwdForDeductTicket' && that.checkPwdForDeductTicket.id) ||
        (name === 'checkPwdForDeductFee' && that.checkPwdForDeductFee.id) ||
        (name === 'closePwdForTransfer' && that.closePwdForTransfer.id) ||
        (name === 'closePwdForExPackage' && that.closePwdForExPackage.id) ||
        //(name === 'addAccount' && that.addAccount.id) ||
        (name === 'pwdExpiry' && that.pwdExpiry.id) ||
        (name === 'deviceQrCode' && that.deviceQrCode.id) ||
        (name === 'autoPromote' && that.autoPromote.id) ||
        (name === 'thirdOrderPrice' && that.thirdOrderPrice.id) ||
        (name === 'thirdIncome' && that.thirdIncome.id) ||
        (name === 'coinClearAdd' && that.coinClearAdd.id) ||
        (name === 'diffDeductCoin' && that.diffDeductCoin.id) ||
        (name === 'diffDeductLottery' && that.diffDeductLottery.id) ||
        (name === 'diffDeductACoin' && that.diffDeductACoin.id) ||
        (name === 'diffDeductALottery' && that.diffDeductALottery.id) ||
        (name === 'operateCoin' && that.operateCoin.id) ||
        (name === 'operateLottery' && that.operateLottery.id) ||
        (name === 'operateACoin' && that.operateACoin.id) ||
        (name === 'operateALottery' && that.operateALottery.id) ||
        (name === 'operateCredit' && that.operateCredit.id) ||
        (name === 'operateGrowth' && that.operateGrowth.id) ||
        (name === 'memberPhoneLimit' && that.memberPhoneLimit.id) ||
        (name === 'memberCertLimit' && that.memberCertLimit.id) ||
        (name === 'ticketPrintType' && that.ticketPrintType.id) ||
        (name === 'ticketType' && that.ticketType.id) ||
        (name === 'gateLanguage' && that.gateLanguage.id) ||
        (name === 'thousandsSeparator' && that.thousandsSeparator.id) ||
        (name === 'barReaderControl' && that.barReaderControl.id) ||
        (name === 'barAccountLogin' && that.barAccountLogin.id) ||
        (name === 'barImageVerify' && that.barImageVerify.id)||
        (name === 'defaultPwd' && that.defaultPwd.id)
      ) {
        url = '/bis/bisSysParameter/edit'
        method = 'put'
      } else {
        url = '/bis/bisSysParameter/add'
        method = 'post'
      }
      if (name === 'currencySymbol') {
        if (!that.currencySymbol.svalue) {
          that.$message.warning(that.$t('金额符号不能为空'))
          return
        }
        querydata = Object.assign({}, that.currencySymbol)
      }
      if (
        name === 'diffDeductCoin' ||
        name === 'diffDeductLottery' ||
        name === 'diffDeductACoin' ||
        name === 'diffDeductALottery'
      ) {
        if (
          that.diffDeductCoin.ivalue == 0 &&
          that.diffDeductLottery.ivalue == 0 &&
          that.diffDeductACoin.ivalue == 0 &&
          that.diffDeductALottery.ivalue == 0
        ) {
          that.$message.warning(that.$t('请至少开启一种扣费方式'))
          that.getParameter(name)
          return
        }
      }
      if (name === 'thousandsSeparator') {
        querydata = Object.assign({}, that.thousandsSeparator)
      }
      if (name === 'autoUseTicket') {
        querydata = Object.assign({}, that.autoUseTicket)
      }
      if (name === 'checkOutReceivable') {
        querydata = Object.assign({}, that.checkOutReceivable)
      }
      if (name === 'registerCheckIdCard') {
        if (that.registerCheckIdCard.ivalues === true) {
          that.registerCheckIdCard.ivalue = 1
        } else {
          that.registerCheckIdCard.ivalue = 0
        }
        querydata = Object.assign({}, that.registerCheckIdCard)
      }
      if (name === 'dayConsumeLimit') {
        if (!that.dayConsumeLimit.ivalue) {
          that.$message.warning(that.$t('消费限额不能为空'))
          return
        }
        querydata = Object.assign({}, that.dayConsumeLimit)
      }
      if (name === 'closePwdForExCoin') {
        querydata = Object.assign({}, that.closePwdForExCoin)
      }
      if (name === 'closePwdForExGoods') {
        querydata = Object.assign({}, that.closePwdForExGoods)
      }
      if (name === 'closePwdForExTicket') {
        querydata = Object.assign({}, that.closePwdForExTicket)
      }
      if (name === 'checkPwdForDeductTicket') {
        querydata = Object.assign({}, that.checkPwdForDeductTicket)
      }
      if (name === 'checkPwdForDeductFee') {
        querydata = Object.assign({}, that.checkPwdForDeductFee)
      }
      if (name === 'closePwdForTransfer') {
        querydata = Object.assign({}, that.closePwdForTransfer)
      }
      if (name === 'closePwdForExPackage') {
        querydata = Object.assign({}, that.closePwdForExPackage)
      }
      /* if (name === 'addAccount') {
        querydata = Object.assign({}, that.addAccount)
      } */
      if (name === 'pwdExpiry') {
        if (that.addExpiryIvalues === true) {
          that.pwdExpiry.ivalue = 1
        } else {
          that.pwdExpiry.ivalue = 0
        }
        querydata = Object.assign({}, that.pwdExpiry)
      }
      if (name === 'deviceQrCode') {
        querydata = Object.assign({}, that.deviceQrCode)
      }
      if (name === 'autoPromote') {
        querydata = Object.assign({}, that.autoPromote)
      }
      if (name === 'thirdOrderPrice') {
        querydata = Object.assign({}, that.thirdOrderPrice)
      }
      if (name === 'thirdIncome') {
        querydata = Object.assign({}, that.thirdIncome)
      }
      if (name === 'coinClearAdd') {
        querydata = Object.assign({}, that.coinClearAdd)
      }
      if (name === 'diffDeductCoin') {
        querydata = Object.assign({}, that.diffDeductCoin)
      }
      if (name === 'diffDeductLottery') {
        querydata = Object.assign({}, that.diffDeductLottery)
      }
      if (name === 'diffDeductACoin') {
        querydata = Object.assign({}, that.diffDeductACoin)
      }
      if (name === 'diffDeductALottery') {
        querydata = Object.assign({}, that.diffDeductALottery)
      }
      if (name === 'operateCoin') {
        if (that.operateCoin.ivalues === true) {
          that.operateCoin.ivalue = 1
        } else {
          that.operateCoin.ivalue = 0
        }
        querydata = Object.assign({}, that.operateCoin)
      }
      if (name === 'operateLottery') {
        if (that.operateLottery.ivalues === true) {
          that.operateLottery.ivalue = 1
        } else {
          that.operateLottery.ivalue = 0
        }
        querydata = Object.assign({}, that.operateLottery)
      }
      if (name === 'operateACoin') {
        if (that.operateACoin.ivalues === true) {
          that.operateACoin.ivalue = 1
        } else {
          that.operateACoin.ivalue = 0
        }
        querydata = Object.assign({}, that.operateACoin)
      }
      if (name === 'operateALottery') {
        if (that.operateALottery.ivalues === true) {
          that.operateALottery.ivalue = 1
        } else {
          that.operateALottery.ivalue = 0
        }
        querydata = Object.assign({}, that.operateALottery)
      }
      if (name === 'operateCredit') {
        if (that.operateCredit.ivalues === true) {
          that.operateCredit.ivalue = 1
        } else {
          that.operateCredit.ivalue = 0
        }
        querydata = Object.assign({}, that.operateCredit)
      }
      if (name === 'operateGrowth') {
        if (that.operateGrowth.ivalues === true) {
          that.operateGrowth.ivalue = 1
        } else {
          that.operateGrowth.ivalue = 0
        }
        querydata = Object.assign({}, that.operateGrowth)
      }
      if (name === 'memberPhoneLimit') {
        querydata = Object.assign({}, that.memberPhoneLimit)
      }
      if (name === 'memberCertLimit') {
        querydata = Object.assign({}, that.memberCertLimit)
      }
      if (name === 'ticketPrintType') {
        querydata = Object.assign({}, that.ticketPrintType)
      }
      if (name === 'ticketType') {
        querydata = Object.assign({}, that.ticketType)
      }
      if (name === 'gateLanguage') {
        querydata = Object.assign({}, that.gateLanguage)
      }
      if (name === 'barReaderControl') {
        querydata = Object.assign({}, that.barReaderControl)
      }
      if (name === 'barAccountLogin') {
        querydata = Object.assign({}, that.barAccountLogin)
      }
      if (name === 'barImageVerify') {
        querydata = Object.assign({}, that.barImageVerify)
      }
      if (name === 'defaultPwd') {
        if (that.defaultPwdIvalues === true) {
          that.defaultPwd.ivalue = 1
          if (that.defaultPwd.svalue.length < 6) {
            that.$message.warning(that.$t('请输入6位数字消费密码'))
            return
          }
        } else {
          that.defaultPwd.ivalue = 0
        }
        querydata = Object.assign({}, that.defaultPwd)
      }
      httpAction(url, querydata, method).then((res) => {
        if (res.success) {
          that.$message.success(res.message)
          that.getParameter(name)
        } else {
          that.$message.warning(res.message)
        }
      })
    },
    getJobInfo(jobClassName) {
      let that = this
      return new Promise((resolve) => {
        getAction('/sys/quartzJob/list', {
          jobClassName: jobClassName,
          parameter: Vue.ls.get('TENANT_ID'),
        }).then((res) => {
          if (res.success) {
            if (res.result.records.length > 0) {
              resolve(res.result.records[0])
              return
            }
            resolve({ id: '', cronExpression: '', status: false })
          } else {
            that.$message.error(res.message)
            resolve({ id: '', cronExpression: '', status: false })
          }
        })
      })
    },
    saveJob(jobClassName,obj){
      let that = this
      let httpUrl = '/sys/quartzJob/add',
        method = 'post',
        query = {}
      if (obj.id) {
        httpUrl = '/sys/quartzJob/edit'
        query.id = obj.id
      }
      query.cronExpression = obj.time ? dateChangeCron(moment('2024/01/01 ' + obj.time + ':00').format('YYYY/MM/DD HH:mm:ss'), true) : ''
      query.jobClassName = jobClassName
      query.parameter = Vue.ls.get('TENANT_ID')
      query.status = obj.status
      query.description = obj.description
      httpAction(httpUrl, query, method).then((res) => {
        if (res.success) {
          that.$message.success(res.message)
          if(jobClassName == 'org.jeecg.modules.business.quartz.job.MemberReportJob'){
            that.getTime()
          }
          if(jobClassName == 'org.jeecg.modules.business.quartz.job.AutoCheckOutJob'){
            that.getCheckParam()
          }
        } else {
          that.$message.error(res.message)
        }
      })
    },
    async getCheckParam() {
      let that = this
      let obj = await that.getJobInfo('org.jeecg.modules.business.quartz.job.AutoCheckOutJob')
      if (obj.id) {
        that.checkId = obj.id
        that.checkState = obj.status ? false : true
        that.checkTime = moment(new Date(moment().format('YYYY-MM-DD') + ' ' + cronChangeDate(obj.cronExpression).loopTime.split(' ')[1])).format('HH:mm')
      }
    },
    checkSave() {
      let that = this
      if (that.checkState && !that.checkTime) {
        that.$message.warning(that.$t('请选择结账时间'))
        return
      }
      let obj={
        id: that.checkId,
        time: that.checkTime,
        status: that.checkState ? 0 : 1,
        description: '自动结算'
      }
      that.saveJob('org.jeecg.modules.business.quartz.job.AutoCheckOutJob', obj)
    },
    changeSelectState(e, name, key, type, arg){
      if (type == 1) {
        this.$set(this[name], key, e.target.checked ? 1 : 0)
      }
      if(type == 2){
        this.$set(this[name], key, e.target.checked ? 'Y' : 'N')
        
      }
      this.$set(this[name], key+'Disable', !e.target.checked)
      if(arg == 'autoSave'){
        this.parameterChange(name)
      }
    },
    changeSelectState1(e, name, key, type, arg) {
      if(name == 'thirdIncome' && this.thirdOrderPrice.ivalue == 0){
        this.$message.error(this.$t("此功能需要配合订单记账功能使用，请先开启订单记账功能"))
        return
      }
      this.changeSelectState(e, name, key, type, arg)
    },
    changeSelectState2(e, name, key, type, arg) {
      this.changeSelectState(e, name, key, type, arg)
      if(!e.target.checked && this.thirdIncome.ivalue == 1){
        this.changeSelectState(e, 'thirdIncome', key, type, arg)
      }
    },
    presentRuleChange() {
      let that = this
      let httpurl = '/bis/bisSysParameter/saveBatch'
      let method = 'post'
      let query = []
      query.push(that.cardCoin)
      query.push(that.cardLottery)
      query.push(that.cardIntegral)
      query.push(that.cardACoin)
      query.push(that.cardALottery)
      httpAction(httpurl, query, method).then((res) => {
        if (res.success) {
          that.$message.success(res.message)
          that.getPresentRule()
        } else {
          that.$message.warning(res.message)
        }
      })
    },
    getPresentRule() {
      axios.all([
        this.queryByName('cardCoin'),
        this.queryByName('cardLottery'),
        this.queryByName('cardIntegral'),
        this.queryByName('cardACoin'),
        this.queryByName('cardALottery'),
      ])
      .then(
        axios.spread((r1, r2, r3, r4, r5) => {
          if (r1.success) {
            this.cardCoin.id = r1.result.id
            this.cardCoin.ivalue = r1.result.ivalue
          }
          if (r2.success) {
            this.cardLottery.id = r2.result.id
            this.cardLottery.ivalue = r2.result.ivalue
          }
          if (r3.success) {
            this.cardIntegral.id = r3.result.id
            this.cardIntegral.ivalue = r3.result.ivalue
          }
          if (r4.success) {
            this.cardACoin.id = r4.result.id
            this.cardACoin.ivalue = r4.result.ivalue
          }
          if (r5.success) {
            this.cardALottery.id = r5.result.id
            this.cardALottery.ivalue = r5.result.ivalue
          }
        })
      )
    },
  },
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>